import { defineStore } from 'pinia'

export const useWaterFlowAdjustmentStore = defineStore('waterFlowAdjustment', {
  state: () => ({
    // 步骤完成状态
    stepOneStatus: false,
    stepTwoStatus: false,
    stepThreeStatus: false,
    // 调节状态
    adjustingStatus: false,
  }),

  getters: {
    // 获取步骤一状态
    getStepOneStatus: (state) => {
      return state.stepOneStatus
    },

    // 获取步骤二状态
    getStepTwoStatus: (state) => {
      return state.stepTwoStatus
    },

    // 获取步骤三状态
    getStepThreeStatus: (state) => {
      return state.stepThreeStatus
    },

    // 获取调节状态
    getAdjustingStatus: (state) => {
      return state.adjustingStatus
    },
  },

  actions: {
    // 完成步骤一
    completeStepOne() {
      this.stepOneStatus = true
    },

    // 完成步骤二
    completeStepTwo() {
      this.stepTwoStatus = true
    },

    // 完成步骤三
    completeStepThree() {
      this.stepThreeStatus = true
    },

    // 设置调节状态
    setAdjustingStatus(status) {
      this.adjustingStatus = status
    },

    // 重置所有状态
    resetAllStatus() {
      this.stepOneStatus = false
      this.stepTwoStatus = false
      this.stepThreeStatus = false
      this.adjustingStatus = false
    },
  },
})